<?php
// 本类由系统自动生成，仅供测试用途
namespace Admin\Controller;
use Think\Controller;
use Org\Util\Authentication;
use Org\Util\Bodyguard;
use Org\Util\HundredCredit;
class IndexController extends Controller {
  /**
   * 后台页面主框架
   */
  public function index() {
    $adminid = $this->Islogin();
    $admindata = M('admin')->where('id='.$adminid)->field('position, tel')->find();
    if($admindata['tel']== '18310072979' || $admindata['position']=='501' || $admindata['position']=='502'){
      $page = '/admin/index/index_s';
    }else if($admindata['position']=='6') {
        $page = '/admin/Order/OrderPayConfirm';
    }else if ($admindata['position'] == '8') {
        $page = '/admin/Order/channelprofit';
    }else if ($admindata['position'] == '9' || $admindata['position']=='901'){
        $page ='/admin/Stock/car_guanli';
    }else if($admindata['position']=='1101'){
      $page = '/admin/login/AddAdmin';
    }else if($admindata['position']=='5'){
      $page = '/admin/channel/channellistindex';
    }else if($admindata['position']=='503'){
      $page = '/admin/order/orderlistindex';
    }
    $this->assign('admindata',$admindata);
    $this->assign('page',$page);
    $this->display('index');
    die;
  }

  /**
   * 后台页面头
   */
  public function headerhtml() {
    $userid = session('lampzuo_id');
    $this->assign("admin_list",M('admin')->where(['id'=>$userid])->field('token,prevlogintime',true)->find());
    $this->display('header');
  }

  /**
   * 后台左页面
   */
  public function leftnavhtml() {
    $userid = session('lampzuo_id');
    $this->assign("admin_list",M('admin')->where(['id'=>$userid])->field('token,prevlogintime',true)->find());
    $this->display('leftnav');
  }

  public function error()
  {
      $this->display('Index/403');
  }
  /**
   * 测试
   */
  public function test() {
    echo '<pre>';
    // $n = [];
    // print_r(array_combine($k,$v));die;
    print_r(json_encode($n,true));die;
    // print_r(json_decode(file_get_contents('./Application/Admin/Common/json_file/PayConsumption.json'),true));
    $credit = new HundredCredit;
    // '511525199607053069','13108319889','左官丽','6228272461220721076'
    // var_dump($credit->specialList('511525199607053069','13108319889','左官丽'));
    var_dump($credit->identityVerific('511525199607053069','左官丽'));
    // var_dump($credit->badInfo('140502198811102244','13986671110','王亮'));
    // var_dump($credit->bankFourPro('140502198811102244','13986671110','王亮','6212260200126541644'));
    // var_dump($credit->telStatus('13986671110','140502198811102244','王亮'));
    // echo '<pre>';
    // $sensitiveArr = json_decode(file_get_contents('./Application/Admin/Common/json_file/ApplyLoanStr.json'),true);
    // print_r($sensitiveArr);
    // die;
    // print_r($credit->educationInquiries('140502198811102244','王亮','13986671110'));
  }

}
